package Behavioral.Visitor;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

// 员工业务报表类
public class BusinessReport {

    private List<Staff> mStaffs = new ArrayList<>();

    public void add(Staff staff)
    {
        mStaffs.add(staff);
    }
    public void remove(Staff staff)
    {
        mStaffs.remove(staff);
    }

    /**
     * 为访问者展示报表
     * @param visitor 公司高层，如CEO、CTO
     */
    public void showReport(Visitor visitor) {
        for (Staff staff : mStaffs) {
            staff.accept(visitor);
        }
    }
}
